package array;

public class Element {
    public int removeElement(int[] array,int val){
        int i =0;
        for (int j=0;j<array.length;j++){
            if (array[j]!=val){
                array[i]=array[j];
                i++;
            }
        }
        return i;
    }
    public static void main(String[] args) {
        int[] array={3,2,2,3};
        Element element = new Element();
        System.out.println(element.removeElement(array, 3));
    }
}
